package me.chan.optional;

import java.util.Optional;

import me.chan.stream.Dish;

public class OptionalDemo {

	public static void main(String[] args) {
		//Optional<Dish> nullableDish = Optional.ofNullable(null);
		//System.out.println(nullableDish);
		
		Dish dish = new Dish("mutton", false, 700, Dish.Type.MEAT);
		Optional<Dish> optDish = Optional.of(dish);
		System.out.println(optDish);
		optDish.ifPresent(d-> System.out.println(d.getName()));
	}
}
